import instance from '../utils/http'
/**
 * 通过并发请求获取全部优惠券的数据
 */
export const reqQuansData = () => {
  return instance.get('/discount/selectAllDiscount')
}
/**
 * 通过userid查看优惠券的数量
 */
export const reqCountQuansData = (userid) => {
    return instance.get(`/userdiscount/countByuserid/?userid=${userid}`)
  }

  /**
 * 通过userid查看优惠券集合
 */
export const reqQuansListData = (userid) => {
    return instance.get(`/discount/selectDiscountByUserid/?userid=${userid}`)
  }

    /**
 *第一次登录查看优惠券集合
 */
export const reqTwoQuanData= ()=> {
    return instance.get(`/discount/selectTwoDiscount`)
  }
  /**
 * 批量新增优惠券
 */
export const reqBatchInsertDiscount = (userdiscounts) => {
    return instance.post('/userdiscount/batchInsertDiscount', userdiscounts);
  };

/**
 * 获取优惠券，以及判断该用户是否以及领取过该优惠券
 * @param {*} userdiscount 
 */
export const selectifdiscount=(userdiscount)=>{
  return instance.post('/discount/selectifdiscount',userdiscount)
}
/**
 * 新增用户优惠券
 * @param {*} userdiscount 
 */
export const getfestquanapi=(userdiscount)=>{
  return instance.post('/userdiscount/getfestquanapi',userdiscount)
}